<%@page import="upcweb.util.CheckLogin"%>
<%@page import="upcweb.modelo.ClsUsuario"%>
<%@page import="upcweb.modelo.ClsComentarioOferta"%>
<%@page import="upcweb.negocio.BsGestionOfertas"%>
<%@page import="upcweb.modelo.ClsOferta"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <div class="widget ">
	      			
	      			<div class="widget-header">
	      				<i class="icon-user"></i>
	      				<h3>Visualizacion de Oferta</h3>
	  				</div> <!-- /widget-header -->					
					<div class="widget-content">
<div>
<%
BsGestionOfertas bsOfe = new BsGestionOfertas();
ClsUsuario nusr = new CheckLogin().getSession(request, response);
if (nusr==null){
	nusr = new ClsUsuario();
}
String nro_ofer = request.getParameter("oferta");
ClsOferta objOfe = null;
if (nro_ofer != null){
 objOfe =  bsOfe.getOfertaByNum(new ClsOferta(nro_ofer,nusr.getNo_usuario()));
 
 %>
 <div style="border-radius:15px;background-color:#E1F1FF;padding-left:15px;margin-bottom:10px;">
 <table width="100%"><tr>
<td><span><img style='border-radius:12px;' src="img/ofertas/oferta_icon.jpg" width="99" height="102" style="border:1px solid black"></span></td>
<td><span><table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="39" colspan="2"><div><h4><%= objOfe.getNo_descripcion() %></h4></div><div style="margin: 10px;" align="right" class='a5'>Publicado por&nbsp;<%=objOfe.getNo_usuario()%>&nbsp;el&nbsp;<%=objOfe.getFe_creacion() %></div></td>
    </tr>
  <tr>
    <td><div align="right">Desde el :</div></td>
    <td><%=objOfe.getFe_inicio()%></td>
  </tr>
  <tr>
    <td><div align="right">Hasta el :</div></td>
    <td><%=objOfe.getFe_final()%></td>
  </tr>
  <tr>
    <td><div align="right">Identificador :</div></td>
    <td><%=objOfe.getNo_Oferta()%></td>
  </tr>
  <tr>
    <td><div align="right">Servicio Ofrecido :</div></td>
    <td><%=objOfe.getNo_servicio() %></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</span>
</td>
</tr>
</table>
</div>

<div>
<!--  Comentarios de la Oferta -->
<table class='tableCss' style="width:100%;" cellspacing="0" cellspadding="0" id="tbl_coments">
<tbody>
<%
for(ClsComentarioOferta clsCom : objOfe.getLstComentarios()){
  %>
<tr style="border-bottom-style 1px solid black;">
<td width="23%" align="center"><div><img style="border-radius:8px;" src="img/users/no_user.jpg" width="50"></div><div><%=clsCom.getNo_usuario() %></div></td>
<td width="77%">
<div class="a6" align="right" ><img class="<%=((clsCom.getLike().equalsIgnoreCase("X"))?"has":"hasNo")%>" onclick="likeComent(this,'<%=clsCom.getNo_Oferta() %>','<%=clsCom.getNo_comentario() %>')" src="img/icons/like.png">&nbsp;<span class="a7"><%=clsCom.getNo_bien() %></span>&nbsp;&nbsp;<img src="img/icons/dislike.png" class="<%=((clsCom.getDislike().equalsIgnoreCase("X"))?"has":"hasNo") %>"  onclick="dislikeComent(this,'<%=clsCom.getNo_Oferta() %>','<%=clsCom.getNo_comentario() %>')">&nbsp;<span class='a8'><%=clsCom.getNo_mal()%></span>&nbsp;&nbsp;&nbsp;<span><img src="img/icons/quita_posicion.png" class="a2" onclick=quitarComentario(this,'<%=nro_ofer %>','<%=clsCom.getNo_comentario() %>')></span></div>
<div class='a4'><%=clsCom.getTx_comentario()%></div>
	<div class='a5'><%=clsCom.getFe_coment() + " a las "+clsCom.getHo_coment() %></div></td>
<%
}
 %>
 </tbody>
 <tfoot>
 <tr><td colspan='3'><textarea id="txt_comen" name="txt_comen" style="width: 90%"></textarea><br>
 <input type="button" class='btn btn-primary id="btn_coment" onclick="agregarComentario('<%=nro_ofer %>')" value="Agregar Comentario"></td></tr>
 </tfoot>
</table>
</td></tr>
</tbody>
<%
}
 %>
 
</table>

</div>
</div>
